﻿using AssemblingComputer.CPU;
using AssemblingComputer.Monitor;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace AssemblingComputer
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ServiceProvider container = RegisterServices())
            {
                var controller = container.GetRequiredService<Computer>();
                controller.MyComputer();
            }
        }


        static ServiceProvider RegisterServices()
        {
            var services = new ServiceCollection();
            services.AddTransient<ICPU, AMD>();
            services.AddTransient<Monitors, Dell>();
            services.AddTransient<Computer>();
            return services.BuildServiceProvider();
        }
    }
}